<div class="container" style="background-color:#FFFFFF; margin:auto; padding: 47px 0 20px 0;width:90%;">
    <form action="index.php?pg=marcarFotos" method="POST">
        <div class="page-header">
            <h3>Cliente: <?php echo $lista[fotos][0]['nome'] ?></h3>
            <h3>Album: <?php echo $lista[fotos][0]['album'] ?></h3>
            <h3>Qtd contratada: <?php echo $lista[fotos][0]['qtd_fotos']; ?> fotos</h3>
            <button type="submit" class="btn btn-success" id="btGravarSelecao">
                <i class="icon-plus icon-white"></i>
                <span>Confirmar</span>
            </button>
            <button type="button" class="btn btn-info" id="btCancelar3" 
                    onclick="window.location='index.php?pg=cliente'">
                <i class="icon-stop icon-white"></i>
                <span>Voltar</span>
            </button>
        </div>
        <table id="tabelaAlbuns" align="center" style="background-color:#FFFFFF; margin:auto; padding: 47px 0 20px 0;width:90%;">
            <input type="hidden" name="qtd_fotos" id="qtd_fotos" value="<?php echo $lista[fotos][0]['qtd_fotos']; ?>"/>
            <input type="hidden" name="qtd_fotos_marcadas" id="qtd_fotos_marcadas" value="<?php echo $lista[fotos][0]['fotos_marcadas']; ?>"/>
            <input type="hidden" name="id_album" value="<?php echo $_GET['idAlbum']; ?>"/>
            <?php if(!empty($lista[fotos])){
                foreach ($lista[fotos] as $k => $v) { 
                    $checked = (in_array(array($v['id_imagens']), $lista[marcadas], true)) ? "checked" : ""; ?>	
                    <tr class="template-download" align="center"><td style="padding-top:8px;">
                            <div class="preview" align="center">
                                <a href="#" title="<?php echo $v['ds_imagem']; ?>"><img src="server/php/thumbnails/<?php echo strtr($v['pasta'], array(' ' => '_')) . '/' . $v['ds_imagem']; ?>"></a>
                            </div>
                            <br/>
                            <div class="name" align="center">
                                <a href="#" title="<?php echo $v['album']; ?>"><?php echo $v['ds_imagem']; ?></a>
                            </div>
                            <div>
                                <input type="checkbox" name="fotosSelecionada[]" value="<?php echo $v['id_imagens']; ?>" <?php echo $checked; ?>
                                       onclick="album.validaQtdFotosSelecionadas(this);">
                            </div>
                        </td>
                    </tr>
            <?php } 
            }?>
        </table>
    </form>
</div>